
<!DOCTYPE html>
<html lang="en" class="no-js">

    <head>

        <meta charset="utf-8">
        <title>Fullscreen Login</title>
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <meta name="description" content="">
        <meta name="author" content="">

        <!-- CSS -->
        <link rel="stylesheet" href="__PUBLIC__/admin/static/login/css/reset.css">
        <link rel="stylesheet" href="__PUBLIC__/admin/static/login/css/supersized.css">
        <link rel="stylesheet" href="__PUBLIC__/admin/static/login/css/style.css">

        <!-- HTML5 shim, for IE6-8 support of HTML5 elements -->
        <!--[if lt IE 9]>
		<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
        <![endif]-->

    </head>

    <body oncontextmenu="return false">

        <div class="page-container">
            <h1>视频直播后台</h1>
            <form action="" method="post" >
				<div>
					<input type="text" name="username" class="username" placeholder="账号/手机号码" autocomplete="off"/>
				</div>
                <div>
					<input type="password" name="password" class="password" placeholder="请输入密码" oncontextmenu="return false" onpaste="return false" />
                </div>
                <button id="submit" type="button" onclick="login()">登录</button>
            </form>
            <div class="connect">
				<p style="margin-top:20px;font-size: 20px">如果只是遇见，不能停留，不如不遇见<br><br>--上海天启网络科技</p>
				<p style="font-size: 20px;position: fixed;bottom: 30px;top: auto;text-align: center;width: 100%;">Copyright <?php echo $config['copyright']?> by <?php echo $config['system_name']?> <?php echo $config['system_version']?></p>
            </div>
        </div>
		<div class="alert" style="display:none">
			<h2>消息</h2>
			<div class="alert_con">
				<p id="ts"></p>
				<p style="line-height:70px"><a class="btn">确定</a></p>
			</div>
		</div>
        <!-- Javascript -->
		<script src="http://apps.bdimg.com/libs/jquery/1.6.4/jquery.min.js" type="text/javascript"></script>
        <script src="__PUBLIC__/admin/static/login/js/supersized.3.2.7.min.js"></script>
        <script src="__PUBLIC__/admin/static/login/js/supersized-init.js"></script>
        <script type="text/javascript">
            $(".btn").click(function(){
                is_hide();
            })
            var u = $("input[name=username]");
            var p = $("input[name=password]");
            function login(){
                if(u.val() == '' || p.val() =='')
                {
                    $("#ts").html("用户名或密码不能为空~");
                    is_show();
                    return false;
                }
                else{
                    var reg = /^[0-9A-Za-z]+$/;
                    if(!reg.exec(u.val()))
                    {
                        $("#ts").html("用户名错误");
                        is_show();
                        return false;
                    }
                    else{
                        var uv = u.val();
                        var pv = p.val();
                        $.ajax({
                            url:"<?= url('login/login')?>",
                            type:'post',
                            data:{'username':uv,'password':pv},
                            success:function(responser){
                                if(responser.code == 0){
                                    location.href = "<?php echo url('index/index')?>";
                                }else{
                                    $("#ts").html("用户名/密码错误");
                                    is_show();
                                    return false;
                                }
                            }
                        });
                    }
                }
            }
            document.onkeydown=function(event){
                var e = event || window.event || arguments.callee.caller.arguments[0];
                if(e && e.keyCode==13){ // enter 键
                    login();
                }
            };
            window.onload = function()
            {
                $(".connect p").eq(0).animate({"left":"0%"}, 600);
                $(".connect p").eq(1).animate({"left":"0%"}, 400);
            }
            function is_hide(){ $(".alert").animate({"top":"-40%"}, 300) }
            function is_show(){ $(".alert").show().animate({"top":"45%"}, 300) }
        </script>
    </body>

</html>

